use std::{
    fs::{create_dir_all, File},
    io::Write,
};

fn main() {
    println!("cargo:rerun-if-changed=src/district.rs");
    println!("cargo:rerun-if-changed=src/conjecture.rs");
    println!("cargo:rerun-if-changed=src/main.rs");
    println!("cargo:rerun-if-changed=src/district.json");
    let data = include_str!("district.json");
    create_dir_all("src/district").unwrap();
    let mut f = File::create("src/district/data.rs").unwrap();
    f.write_all(b"use crate::object;\n").unwrap();
    f.write_all(b"object!").unwrap();
    f.write_all(data.as_bytes()).unwrap();
}
